<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			var i = 1000;
			var count = 0;
			while(i < 5000){
				i *= 1.05;
				count++;
			}
			console.log("需要"+count+"年");
		</script>
	</body>
</html>
